package cn.brilliantfuture.commentry.entity;

// Generated 2012-3-27 13:28:45 by Hibernate Tools 3.3.0.GA

import static javax.persistence.GenerationType.IDENTITY;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.validator.Length;
import org.hibernate.validator.NotNull;

/**
 * ExpressPerson generated by hbm2java
 */
@Entity
@Table(name = "express_person", catalog = "cabinet")
public class ExpressPerson implements java.io.Serializable {
	private static final long serialVersionUID = 1L;
	private Integer expressPersonId;
	private ExpressInfo expressInfo;
	private String name;
	private String phone;
	private String divisionName;
	private String divisionPhone;
	private Date insertTime;
	private Integer insertUser;
	private boolean deleted;
	private Date deleteTime;
	private String expressCode;//编号

	private Set<OrderInformation> orderInformations = new HashSet<OrderInformation>(0);
	public ExpressPerson() {
	}

	public ExpressPerson( ExpressInfo expressInfo, String name, String phone, Date insertTime, int insertUser, boolean deleted,Set<OrderInformation> orderInformations,String expressCode) {
		this.expressInfo = expressInfo;
		this.orderInformations = orderInformations;
		this.name = name;
		this.phone = phone;
		this.insertTime = insertTime;
		this.insertUser = insertUser;
		this.deleted = deleted;
		this.expressCode = expressCode;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "express_person_id", unique = true, nullable = false)
	public Integer getExpressPersonId() {
		return this.expressPersonId;
	}

	public void setExpressPersonId(Integer expressPersonId) {
		this.expressPersonId = expressPersonId;
	}

	@Column(name = "name", nullable = false, length = 50)
	@NotNull
	@Length(max = 50)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "phone", nullable = false, length = 11)
	@NotNull
	@Length(max = 11)
	public String getPhone() {
		return this.phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "insert_time", nullable = false, length = 19)
	@NotNull
	public Date getInsertTime() {
		return this.insertTime;
	}

	public void setInsertTime(Date insertTime) {
		this.insertTime = insertTime;
	}

	@Column(name = "insert_user", nullable = false)
	public Integer getInsertUser() {
		return insertUser;
	}

	public void setInsertUser(Integer insertUser) {
		this.insertUser = insertUser;
	}
	
	@Column(name = "deleted", nullable = false)
	public boolean getDeleted() {
		return this.deleted;
	}

	public void setDeleted(boolean deleted) {
		this.deleted = deleted;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "express_info_id", nullable = false)
	public ExpressInfo getExpressInfo() {
		return expressInfo;
	}

	public void setExpressInfo(ExpressInfo expressInfo) {
		this.expressInfo = expressInfo;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "expressPerson")
	public Set<OrderInformation> getOrderInformations() {
		return orderInformations;
	}

	public void setOrderInformations(Set<OrderInformation> orderInformations) {
		this.orderInformations = orderInformations;
	}

	@Column(name = "division_name", length = 50)
	public String getDivisionName() {
		return divisionName;
	}

	public void setDivisionName(String divisionName) {
		this.divisionName = divisionName;
	}

	@Column(name = "division_phone", length = 11)
	public String getDivisionPhone() {
		return divisionPhone;
	}

	public void setDivisionPhone(String divisionPhone) {
		this.divisionPhone = divisionPhone;
	}

	@Column(name = "express_code", nullable = false, length = 50)
	@NotNull
	public String getExpressCode() {
		return expressCode;
	}

	public void setExpressCode(String expressCode) {
		this.expressCode = expressCode;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "delete_time", length = 19)
	public Date getDeleteTime() {
		return deleteTime;
	}

	public void setDeleteTime(Date deleteTime) {
		this.deleteTime = deleteTime;
	}

}
